import pykakasi


def parse_sentence(s):
    kks = pykakasi.kakasi()
    parsed = kks.convert(s)
    res = ['<ruby>']
    for item in parsed:
        orig = item['orig']
        hira = item['hira']
        if orig != hira:
            res.append(f'<rb>{orig}</rb><rt>{hira}</rt>')
        else:
            res.append(f'<rb>{orig}</rb><rt></rt>')
    res.append('</ruby>')
    return '\n'.join(res)


def main():
    sentence = "人間讚歌は「勇気」の讚歌！人間のすばらしさは勇気のすばらしさ！"
    print(parse_sentence(sentence))


if __name__ == '__main__':
    main()